package com.uplooking.controller;

import com.uplooking.service.AddDraft;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.sql.SQLException;

public class AddDraftController extends HttpServlet{
    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        String username = req.getParameter("username");
        String title = req.getParameter("title");
        String artical = req.getParameter("artical");
        AddDraft addDraft = new AddDraft();
        try {
            Integer addDraft1 = addDraft.getAddDraft(username, title, artical);
            resp.getWriter().print(0);
        } catch (SQLException e) {
            e.printStackTrace();
        }

    }
}
